Add menu option to manually check for update.
authorrobertl <robertl>
Tue, 16 Feb 2010 02:49:43 +0000 (02:49 +0000)
committerrobertl <robertl>
Tue, 16 Feb 2010 02:49:43 +0000 (02:49 +0000)
gui/mainwindow.cpp
gui/mainwindow.h
gui/mainwinui.ui

index 42b5a883627e3828d422f3df81d18233f70ceef9..7569d71f92a1f0b4396646c21e22bb8e3398d49b 100644 (file)
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-// $Id: mainwindow.cpp,v 1.16 2010/02/15 02:57:00 robertl Exp $
+// $Id: mainwindow.cpp,v 1.17 2010/02/16 02:49:43 robertl Exp $
 //------------------------------------------------------------------------
 //
 //  Copyright (C) 2009  S. Khai Mong <khai@mangrai.com>.
@@ -132,6 +132,7 @@ MainWindow::MainWindow(QWidget* parent): QMainWindow(parent)
   connect(ui.actionQuit, SIGNAL(triggered()), this, SLOT(closeActionX()));
   connect(ui.actionHelp, SIGNAL(triggered()), this, SLOT(helpActionX()));
   connect(ui.actionAbout, SIGNAL(triggered()), this, SLOT(aboutActionX()));
+  connect(ui.actionUpgradeCheck, SIGNAL(triggered()), this, SLOT(upgradeCheckActionX()));
   connect(ui.actionPreferences, SIGNAL(triggered()), this, SLOT(preferencesActionX()));
 
   connect(ui.inputFormatCombo,  SIGNAL(currentIndexChanged(int)),
@@ -172,8 +173,8 @@ MainWindow::MainWindow(QWidget* parent): QMainWindow(parent)
   //--- Restore from registry
   restoreSettings();
 
+  upgrade = new UpgradeCheck(parent, formatList);
   if (bd.startupVersionCheck) {
-    upgrade = new UpgradeCheck(parent, formatList);
     upgrade->checkForUpgrade(babelVersion, bd.upgradeCheckMethod, 
                              bd.upgradeCheckTime, bd.installationUuid,
                              bd.reportStatistics);
@@ -961,6 +962,14 @@ void MainWindow::aboutActionX()
   aboutDlg.exec();
 }
 
+//------------------------------------------------------------------------
+void MainWindow::upgradeCheckActionX()
+{
+    upgrade->checkForUpgrade(babelVersion, bd.upgradeCheckMethod, 
+                             QDateTime(), bd.installationUuid,
+                             bd.reportStatistics);
+}
+
 //------------------------------------------------------------------------
 void MainWindow::preferencesActionX()
 {
index 09d7713da4e71d5b267b835af8a7771ff78c7053..d8c0b02103caa2916ec52d6df3fd1b9ba1ff4792 100644 (file)
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-// $Id: mainwindow.h,v 1.8 2010/02/14 21:29:06 robertl Exp $
+// $Id: mainwindow.h,v 1.9 2010/02/16 02:49:43 robertl Exp $
 //------------------------------------------------------------------------
 //
 //  Copyright (C) 2009  S. Khai Mong <khai@mangrai.com>.
@@ -105,6 +105,7 @@ protected:
   void outputOptionButtonClicked();
   void preferencesActionX();
   void resetFormatDefaults();
+  void upgradeCheckActionX();
 
 };
 
index 62b123243b394c6f014b8bf8d891ebc561768eb1..4f6e108aecb4e5455c827de3bc390752085fcf90 100644 (file)
     <addaction name="actionHelp"/>
     <addaction name="separator"/>
     <addaction name="actionAbout"/>
+    <addaction name="actionUpgradeCheck"/>
    </widget>
    <addaction name="menuFile"/>
    <addaction name="menuHelp"/>
     <string>Preferences...</string>
    </property>
   </action>
+  <action name="actionUpgradeCheck">
+   <property name="text">
+    <string>Check for Upgrade</string>
+   </property>
+  </action>
  </widget>
  <resources>
   <include location="app.qrc"/>